package com.ia.aistream.service.operating.impl;

import java.util.List;
import com.ia.aistream.common.utils.DateUtils;
import com.ia.aistream.mapper.operating.DocRevMapper;
import com.ia.aistream.model.operating.entity.DocRev;
import com.ia.aistream.service.operating.IDocRevService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ia.aistream.common.core.text.Convert;

/**
 * 文档修改跟踪Service业务层处理
 * 
 * @author aistream
 * @date 2021-01-25
 */
@Service
public class DocRevServiceImpl implements IDocRevService
{
    @Autowired
    private DocRevMapper docRevMapper;

    /**
     * 查询文档修改跟踪
     * 
     * @param id 文档修改跟踪ID
     * @return 文档修改跟踪
     */
    @Override
    public DocRev selectDocRevById(Long id)
    {
        return docRevMapper.selectDocRevById(id);
    }

    /**
     * 查询文档修改跟踪列表
     * 
     * @param docRev 文档修改跟踪
     * @return 文档修改跟踪
     */
    @Override
    public List<DocRev> selectDocRevList(DocRev docRev)
    {
        return docRevMapper.selectDocRevList(docRev);
    }

    /**
     * 新增文档修改跟踪
     * 
     * @param docRev 文档修改跟踪
     * @return 结果
     */
    @Override
    public int insertDocRev(DocRev docRev)
    {
        docRev.setCreateTime(DateUtils.getNowDate());
        return docRevMapper.insertDocRev(docRev);
    }

    /**
     * 修改文档修改跟踪
     * 
     * @param docRev 文档修改跟踪
     * @return 结果
     */
    @Override
    public int updateDocRev(DocRev docRev)
    {
        docRev.setUpdateTime(DateUtils.getNowDate());
        return docRevMapper.updateDocRev(docRev);
    }

    /**
     * 删除文档修改跟踪对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteDocRevByIds(String ids)
    {
        return docRevMapper.deleteDocRevByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除文档修改跟踪信息
     * 
     * @param id 文档修改跟踪ID
     * @return 结果
     */
    @Override
    public int deleteDocRevById(Long id)
    {
        return docRevMapper.deleteDocRevById(id);
    }
}
